package com.controller;

import com.bean.ZjCookHouse;
import com.bean.other.ResponseData;
import com.service.impl.ZjCookHouseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@CrossOrigin
@RestController
@RequestMapping("api/zj")
public class ZjCookHouseController {

    @Autowired
    private ZjCookHouseService zjCookHouseService;

    //1、初始化自己的厨房。厨房名，自己的名称，
    public ResponseEntity initCookHouse(@RequestBody ZjCookHouse zjCookHouse){
        String message = zjCookHouseService.initCookHouse(zjCookHouse);
        if(message.contains("成功")){
            return ResponseEntity.ok(ResponseData.success(message));
        }else{
            return ResponseEntity.ok(ResponseData.error(message));
        }
    }

    //2、我要加入“***”的厨房， 返回链接页面   不需要API，不需要过程，仅需要一个简单的页面。

    //3、咱家菜谱   新增菜品  删除菜谱

    //4、咱家成员   删除成员，

    //5、咱家厨师

}
